<#macro indexListItem item>
<#if item.type??&&item.type==110>
			<div class="list-div">
            		<a href="${webroot}/invest/detail.html?borrowid=${item.id?c}">
                    <div class="itam-img">
                    	<img src="${webroot}/imgurl.html?userid=${item.user_id?c}&size=middle" class="productimg">
                    </div>
                    </a>
                    <ul class="list-ul">
                        <li class="titleli" style="position: relative;">
                           <span>
                                <a href="${webroot}/invest/detail.html?borrowid=${item.id?c}" class="titletxt">
<#if item.name?length lt 20>${item.name}<#else>${item.name[0..10]}...</#if>&nbsp;&nbsp;</a>
                           </span>     
                       	   <@showBorrowIcon item=item/>
						 <span style="font-size:14px;position: absolute;left: 390px;">
						 <b>借款金额：￥</b><strong><font color="red">${format2(item.account)}元</font></strong>
						 </span>
                        </li> 
                       <li>
                          发布者：<strong><font color="red">${item.username}</font></strong>
                        </li>
						 <li>
                        年利率：${item.apr!}%
                        </li> 
						<li class="clearfix">
投标奖励：<#if item.award??&&item.award==0>	没有奖励
								<#elseif item.award??&&item.award==1>
							 		${(item.part_account)!0}%奖励
								<#elseif item.award??&&item.award==2>
									￥${(item.funds)!0}元奖励
								<#else>
								</#if>
                        </li>
						   <li>
                            借款期限：<#if item.isday??&&item.isday==1><strong>${item.time_limit_day!0}</strong>天
                        <#elseif item.type==101>满标自动还款
                            <#else><strong>${(item.time_limit)?default("0")}</strong>个月</#if>
                        </li>
						 <li class="clearfix">
                            <span style="float:left">最小流转金额：￥<b><font color="red">${(item.flow_money!0)?c}元</font></b>
                        </li>
						<li>
						 已流转：${((item.account_yes!0)?number/item.flow_money)?c}份
						</li>
                      <li>
还剩：${(((item.account!0)?number-(item.account_yes!0)?number)/item.flow_money)?string("##.##")}份
                        </li>                         
                        <li>
                            到期一次性还款
                        </li>
                    </ul>
<div class="list-btnbox">
                        <a href="${webroot}/invest/detail.html?borrowid=${item.id?c}" class="list-btn"><@showIndexTenderButton item /></a>
                    </div>
                </div>
<#else>
            <div class="list-div">
            		<a href="${webroot}/invest/detail.html?borrowid=${item.id?c}">
                    <div class="itam-img">
                    	<img src="${webroot}/imgurl.html?userid=${item.user_id?c}&size=middle" class="productimg">
                    </div>
                    </a>
                    <ul class="list-ul">
                        <li class="titleli" style="position: relative;">
                           <span>
                                <a href="${webroot}/invest/detail.html?borrowid=${item.id?c}" class="titletxt">
<#if item.name?length lt 20>${item.name}<#else>${item.name[0..10]}...</#if>&nbsp;&nbsp;</a>
                           </span>     
                       	   <@showBorrowIcon item=item/>
						 <span style="font-size:14px;position: absolute;left: 390px;">
						 <b>借款金额：￥</b><strong><font color="red">${format2(item.account)}元</font></strong>
						 </span>
                        </li> 
                       <li>
                          发布者：<strong><font color="red">${item.username}</font></strong>
                        </li>
						 <li>
                            年利率：${item.apr}%
                        </li> 
						                        <li class="clearfix">
                            <div class="float_left">已完成：</div>
                            <div class="jindu float_left">
 <div class="rate_tiao" style="width:
<#if ((item.scales*100)?string("##.######"))?number -99.99 lte 0.01 && ((item.scales*100)?string("##.######"))?number -99.99 gte 0>
99.9%
<#else>
${(item.scales*100)?string("##.##")}%
</#if>"></div>
                            </div>
                            <div class="float_left">&nbsp;
<#if ((item.scales*100)?string("##.######"))?number -99.99 lt 0.01 && ((item.scales*100)?string("##.######"))?number -99.99 gt 0>
99.99%
<#else>
${(item.scales*100)?string("##.##")}%
</#if></div>
                        </li>
						   <li>
                            借款期限：<#if item.isday??&&item.isday==1><strong>${item.time_limit_day!0}</strong>天
                        <#elseif item.type==101>满标自动还款
                            <#else><strong>${(item.time_limit)?default("0")}</strong>个月</#if>
                        </li>
						                        <li class="clearfix">
                            <span style="float:left">信用等级：</span><img class="rank" src="${request.getContextPath()}/data/images/credit/${item.credit_pic}" title="${item.credit_jifen}"  />
                        </li>
						<li>
						<#if item.status==1>剩余时间：<@showRemainTime addtime=item.addtime valid_time=item.valid_time /><#else>已结束</#if>
						</li>
						
						
						
                      <li>
                            投标奖励：<#if item.award??&&item.award==0>	没有奖励
								<#elseif item.award??&&item.award==1>
							 		${(item.part_account)!0}%奖励
								<#elseif item.award??&&item.award==2>
									￥${(item.funds)!0}元奖励
								<#else>
								</#if>
                        </li>                         
                        <li>
                            <#if item.isday??&&item.isday==1>到期全额还款<#elseif
							item.type==101>系统自动还款<#else>按月分期还款</#if> 
                        </li>
                    </ul>
                    <div class="list-btnbox">
                        <a href="${webroot}/invest/detail.html?borrowid=${item.id?c}" class="list-btn"><@showIndexTenderButton item /></a>
                    </div>
                </div>
            
</#if>
</#macro>

<#macro showIndexTenderButton borrow>
    <#assign nowTime=dateformat("now") >
	<#if borrow.status==0>等待初审
	<#elseif (getRemainTime(borrow.addtime,borrow.valid_time)?number lt 0)&&borrow.type!=110&&borrow.status==1>
	 已经结束
	<#elseif borrow.status==1&&((borrow.account_yes)?number lt (borrow.account)?number) > 
	立即投标
	<#elseif borrow.status==1&&((borrow.account_yes)?number gt (borrow.account)?number || (borrow.account_yes)?number==(borrow.account)?number) > 
	等待复审
	<#elseif borrow.status==2> 
	初审失败
	<#elseif borrow.status==3> 
	复审通过
	<#elseif borrow.status==5||borrow.status==-1> 
	用户取消</a>
	<#elseif borrow.status==4> 
	复审失败
	<#elseif borrow.status==6> 
	还款中</a>
	<#elseif borrow.status==7> 
	还款中</a>
	<#elseif borrow.status==8> 
	已还款</a>
	<#else> 
	用户取消</a> 
	</#if> 
</#macro>
